#include<bits/stdc++.h>
using namespace std;
char a[505],b[505];
int main()
{
	double m,js=0;
	cin>>m>>a>>b;
	int n=strlen(a);
	
	for (int i=1; i<=n; i++)
	{
		if (a[i]==b[i]) js++;
	}
	if (js/n>=m) cout<<"yes"<<endl;
	else cout<<"no"<<endl;
	
	return 0;
}